home *** CD-ROM | disk | FTP | other *** search
/ Revista do CD-ROM 78 / CD-ROM 78.iso / Internet / swflet / swflet.exe / _SETUP.1 / coolpage.cpao < prev    next >
Encoding:
Text File  |  2001-08-08  |  13.9 KB  |  386 lines

  1. <HTML>
  2. <HEAD>
  3. <SCRIPT LANGUAGE="JavaScript">
  4. <!-- Begin
  5. // Put all strings here for easier translation to other languages
  6. var title = "Flare SWFlet Publish";
  7. var swf_file="preview1.swf";
  8. var swf_path="C:\\Program Files\\Flare\\";
  9. var requires_cp = "The file requires Cool Page to be viewed";
  10. var requires_cp_update = "To edit this object, please upgrade your copy of Cool Page to the latest version";
  11. var unexpected_error = "An unexpected error occurred. Please notify http://www.imediabuilders.com";
  12. var swfwidth=468;
  13. var swfheight=60;
  14. var current = new Array("swfwidth","swfheight","swfsize","swfloop","swfmenu","swfplay");
  15. current["swfloop"]="true";
  16. current["swfmenu"]="true";
  17. current["swfplay"]="true";
  18. var editor=window.external.GetObjectEditor("-1");
  19.  
  20. document.write( "<TITLE>" + title + "</TITLE>" );
  21.  
  22. // Not running inside Cool Page?
  23. if( !window.external || !window.external.Undefined || !window.external.Defined || 
  24.     (undefined = window.external.Undefined()) == (defined = window.external.Defined() ))
  25. {
  26.     AlertClose( requires_cp );
  27. }
  28.  
  29. // Initialize HTML for the first time
  30. if(window.external.GetObjectHTML("-1") == defined)
  31.     window.external.SetObjectSize("-1","1","1");
  32.  
  33. // Not running a version of Cool Page which supports all the APIs we use?
  34. // (note: add to this test any Cool Page APIs you call in this file)
  35. var w, h;
  36. if( defined == undefined
  37.     || !window.external.GetSelectedObject || window.external.GetSelectedObject( "-1" ) == undefined
  38.     || !window.external.GetObjectClass || window.external.GetObjectClass( "-1" ) != "PageHTML"
  39.     || !window.external.SetObjectEditorName || window.external.SetObjectEditorName( "-1", title ) == undefined
  40.     || !window.external.GetObjectWidth || (w = window.external.GetObjectWidth( "-1" )) == undefined
  41.     || !window.external.GetObjectHeight || (h = window.external.GetObjectHeight( "-1" )) == undefined
  42.     || !window.external.SetObjectSize || window.external.SetObjectSize( "-1", w, h ) == undefined
  43.     || !window.external.GetObjectHTML || (h = window.external.GetObjectHTML( "-1" )) == undefined
  44.     || !window.external.SetObjectHTML || window.external.SetObjectHTML( "-1", (h == defined ? "" : h) ) == undefined
  45.     || !window.external.GetObjectFiles || window.external.GetObjectFiles( "-1", ";" ) == undefined
  46.     || !window.external.SetObjectFiles // unrealistic to check all argument variants here just assume they are supported || window.external.SetObjectFiles( "-1", file0, file1, ... fileN ) == undefined
  47.       || !window.external.CopyFile || window.external.CopyFile("","") == undefined
  48. )
  49. {
  50.     AlertClose( requires_cp_update );
  51. }
  52. function AlertClose(msg)
  53. {
  54.     alert(msg);
  55.     document.write("<HEAD><BODY></BODY></HEAD></HTML>");
  56.     document.close();
  57. }
  58. function ChkErr( return_value )
  59. {
  60.     if( return_value == "" || return_value == undefined )
  61.     {
  62.         AlertClose( unexpected_error );
  63.         return undefined;
  64.     }
  65.     return return_value;
  66. }
  67.  
  68. var prefix = "file:///";
  69. var url = window.location.href;
  70. if(url.indexOf(prefix) != 0)
  71. {
  72.     alert(unexpected_error);
  73. }
  74. var temp_folder=url.substring(prefix.length, url.lastIndexOf("/")).replace( /%20/g, " ").replace( /\//g, "\\");
  75.  
  76. // Return current values of HTML object
  77. function ParseHTML()
  78. {
  79.       current["swfwidth"] = swfwidth;
  80.       current["swfheight"] = swfheight;
  81.  
  82.      var html = ChkErr(window.external.GetObjectHTML("-1"));
  83.       if(html==defined)
  84.         return;
  85.  
  86.       current["swfwidth"] = ChkErr(window.external.GetObjectWidth("-1"));
  87.       current["swfheight"] = ChkErr(window.external.GetObjectHeight("-1"));
  88.       current["swfsize"] = "0";
  89.  
  90.       s = 'current["swfsize"] = ';
  91.       i = html.indexOf(s);
  92.       if(i<0) alert(unexpected_error);
  93.       else
  94.       {
  95.         s = html.substring(i+s.length);
  96.         i = s.indexOf(';');
  97.         if(i<0)alert(unexpected_error);
  98.         else current["swfsize"] = s.substring(1,i-1);
  99.       }
  100.       s = 'current["swfplay"] = ';
  101.       i = html.indexOf(s);
  102.       if(i<0) alert(unexpected_error);
  103.       else
  104.       {
  105.         s = html.substring(i+s.length);
  106.         i = s.indexOf(';');
  107.         if(i<0)alert(unexpected_error);
  108.         else current["swfplay"] = s.substring(1,i-1);
  109.       }
  110.       s = 'current["swfmenu"] = ';
  111.       i = html.indexOf(s);
  112.       if(i<0) alert(unexpected_error);
  113.       else
  114.       {
  115.         s = html.substring(i+s.length);
  116.         i = s.indexOf(';');
  117.         if(i<0)alert(unexpected_error);
  118.         else current["swfmenu"] = s.substring(1,i-1);
  119.       }
  120.       s = 'current["swfloop"] = ';
  121.       i = html.indexOf(s);
  122.       if(i<0) alert(unexpected_error);
  123.       else
  124.       {
  125.         s = html.substring(i+s.length);
  126.         i = s.indexOf(';');
  127.         if(i<0)alert(unexpected_error);
  128.         else current["swfloop"] = s.substring(1,i-1);
  129.       }
  130. }
  131.  
  132. // Assign current values to GUI form
  133. function ReadSelectedObject( form )
  134. {
  135.      ParseHTML();
  136.     form.width.value=current["swfwidth"];
  137.     form.height.value=current["swfheight"];
  138.     form.size.selectedIndex=current["swfsize"];
  139.       if(current["swfloop"] == "true")
  140.         form.swfloop.checked = 1;
  141.       else
  142.         form.swfloop.checked = 0;
  143.       if(current["swfmenu"] == "true")
  144.         form.swfmenu.checked = 1;
  145.       else
  146.         form.swfmenu.checked = 0;
  147.       if(current["swfplay"] == "true")
  148.         form.swfplay.checked = 0;
  149.       else
  150.         form.swfplay.checked = 1;
  151.  
  152.       // Copy files to TEMP folder
  153.     ChkErr( window.external.CopyFile( swf_path + swf_file,temp_folder ) );
  154. }
  155.  
  156. // The HTML written to file
  157. function SWF_HTML( which )
  158. {
  159. var w;
  160. var h;
  161. var aspect;
  162. var number;
  163. number=Math.round(100000*Math.random());
  164. if (which==0)
  165. {
  166.    if(swfwidth > 420)
  167.    {
  168.      w=420;
  169.      aspect=420/swfwidth;
  170.      h=swfheight*aspect;
  171.    }
  172.    else
  173.    {
  174.      w=swfwidth;
  175.      h=swfheight;
  176.    }
  177.    num="";
  178. }
  179. else
  180. {
  181.    w=ChkErr(window.external.GetObjectWidth("-1"));
  182.    h=ChkErr(window.external.GetObjectHeight("-1"));
  183.    num=number
  184. }
  185.  
  186. var t="<OBJECT classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\"\r\n";
  187. t+=" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=4,0,0,0\"\r\n";
  188. t+=" id=swfmovie"+num+" width="+w+" height="+h+">\r\n";
  189. t+="<PARAM NAME=movie VALUE=\"" + swf_file + "\" ><PARAM NAME=quality VALUE=high><PARAM NAME=scale VALUE=exactfit>\r\n";
  190. t+="<PARAM NAME=loop VALUE=\"" + current["swfloop"] + "\">\r\n";
  191. t+="<PARAM NAME=menu VALUE=\"" + current["swfmenu"] + "\">\r\n";
  192. t+="<PARAM NAME=play VALUE=\"" + current["swfplay"] + "\">\r\n";
  193. t+="<EMBED src=\"" + swf_file + "\" name=swfmovie"+num;
  194. t+=" pluginspage=\"http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash\"\r\n";
  195. t+=" type=\"application/x-shockwave-flash\"";
  196. t+=" menu="+current["swfmenu"];
  197. t+=" loop="+current["swfloop"];
  198. t+=" play="+current["swfplay"];
  199. t+=" swLiveConnect=true scale=exactfit width="+w+" height="+h+" quality=high></EMBED>\r\n";
  200. t+="</OBJECT>\r\n";
  201. t+="\r\n<SCRIPT LANGUAGE=\"JavaScript\">\r\n";
  202. t+="<!";
  203. t+="-";
  204. t+="-";
  205. t+="\r\nfunction setparam"+num+"()\r\n{\r\n";
  206. t+="var current = new Array(\"swfsize\",\"swfloop\",\"swfmenu\",\"swfplay\");\r\n";
  207. t+="\r\ncurrent[\"swfsize\"] = \"" + window.document.editor.size.selectedIndex + "\";";
  208. t+="\r\ncurrent[\"swfloop\"] = \"" + current["swfloop"] + "\";";
  209. t+="\r\ncurrent[\"swfmenu\"] = \"" + current["swfmenu"] + "\";";
  210. t+="\r\ncurrent[\"swfplay\"] = \"" + current["swfplay"] + "\";\r\n}\r\n";
  211. t+="/";
  212. t+="/";
  213. t+="-";
  214. t+="-";
  215. t+=">";
  216. t+="\r\n</SCRIPT>";
  217. t+="\r\n<IMG SRC=\"t.gif\" ALT=\"\" WIDTH=1 HEIGHT=1 BORDER=0 VSPACE=0 HSPACE=0 onLoad=\"javascript:setparam"+num+"()\">";
  218. return t;
  219. }
  220.  
  221. function WriteSelectedObject( form )
  222. {
  223.     // Unable to resize object in Cool Page (and Cool Page already displayed error to user)?
  224.     if( !window.external.SetObjectSize( "-1", form.width.value, form.height.value) )
  225.         return;
  226.  
  227.     var html=SWF_HTML(1);
  228.      ParseHTML();
  229.  
  230.      ChkErr(window.external.SetObjectFiles("-1")); 
  231.      ChkErr(window.external.SetObjectHTML("-1",html));
  232.     ChkErr(window.external.SetObjectFiles("-1",swf_path+swf_file));
  233. }
  234.  
  235. function passText(str) 
  236. {
  237.     if(str == "size")
  238.     {
  239.         window.document.editor.width.value=swfwidth;
  240.         window.document.editor.height.value=swfheight;
  241.         alert('Width and Height are fixed to the original SWF movie size.');
  242.     }
  243.  
  244.     if(str == "aspect")
  245.         alert('If Width or Height are changed the other dimension will be changed to match the orginal SWF movie aspect ratio.');
  246.  
  247.     if(str == "any")
  248.         alert('Any size Width or Height can be entered.')
  249.  
  250.     WriteSelectedObject( window.document.editor );
  251. }
  252.  
  253. function widthchg(str)
  254. {
  255.     if(str == "size")
  256.     {
  257.         window.document.editor.width.value=swfwidth;
  258.         window.document.editor.height.value=swfheight;
  259.     }
  260.  
  261.     if(str == "aspect")
  262.         window.document.editor.height.value=Math.round((window.document.editor.width.value)*(swfheight/swfwidth));
  263.  
  264.     WriteSelectedObject( window.document.editor );
  265. }
  266.  
  267. function checkboxes()
  268. {
  269.     if(window.document.editor.swfmenu.checked == true)
  270.         current["swfmenu"] = "true";
  271.       else
  272.         current["swfmenu"] = "false";
  273.  
  274.     if(window.document.editor.swfloop.checked == true)
  275.         current["swfloop"] = "true";
  276.       else
  277.         current["swfloop"] = "false";
  278.  
  279.     if(window.document.editor.swfplay.checked == true)
  280.         current["swfplay"] = "false";
  281.       else
  282.         current["swfplay"] = "true";
  283.  
  284.     WriteSelectedObject( window.document.editor );
  285. }
  286.  
  287. function heightchg(str)
  288. {
  289.     if(str == "size")
  290.     {
  291.         window.document.editor.width.value=swfwidth;
  292.         window.document.editor.height.value=swfheight;
  293.     }
  294.  
  295.     if(str == "aspect")
  296.             window.document.editor.width.value=Math.round((window.document.editor.height.value)*(swfwidth/swfheight));
  297.  
  298.     WriteSelectedObject( window.document.editor );
  299. }
  300. // End -->
  301. </SCRIPT>
  302. </HEAD>
  303.  
  304. <STYLE TYPE="text/css">TD {font:normal 10pt Arial, sans-serif; color:#ffff00}</STYLE>
  305.  
  306. <BODY SCROLL="auto"  bgcolor="666699" text="000000" VLINK="#f0f0f0" ALINK="#ffcc00" LINK="#f0f0f0">
  307. <center>
  308.  
  309. <center><table BORDER CELLSPACING=0 >
  310. <tr>
  311. <td BGCOLOR="#00CCCC"> <font color="#0000CC"><b><font size=+3>iMB</font></b><sup><font size=+1>TM</font></sup></font></td>
  312.  
  313. <td BGCOLOR="#FFFFFF">  <b><i><font face="arial"><font color="#DD3300"><font size=+3>Flare</font><sup><font size=+1>TM</font></sup><font size=+3>
  314. Products</font></font></font></i></b></td>
  315. </tr>
  316. </table></center>
  317.  
  318. <center><b><i><font face="arial, helvetica"><font color="#D9D9D9"><font size=-1>Creating
  319. and Publishing Flash for Cool Page.</font></font></font></i></b></center>
  320. <center>
  321. <font face="arial, helvetica" size=2 color="D9D9D9">
  322. <br><b>Visit <a href="http://www.imediabuilders.com" target="imediawin">iMEDIA Builders</a> 
  323. for help creating Flash for Cool Page.</b></font><br><br>
  324. <FORM NAME="editor" ACTION="">
  325. <center><table border=1 bgcolor="DDDDd0"><tr><td>
  326.     <table border=0 cellspacing=0 cellpadding=4>
  327.    <tr>
  328.    <td><font face="arial, helvetica" size=2 color="000000"><b>Preview Controls:</td></b></font>
  329.    <td><input type=button value=Rewind name=sfwrewind onclick="javascript:window.document.swfmovie.rewind()">   
  330.        <input type=button value=Play name=sfwplay onclick="javascript:window.document.swfmovie.play()">   
  331.        <input type=button value=Pause name=sfwpause onclick="javascript:window.document.swfmovie.StopPlay()"></td>
  332.    </tr>   
  333.    <tr>
  334.    <td><font color="000000"><b>Play Settings:</td></b></font>
  335.    <td><input type=checkbox name=swfplay onclick="javascript:checkboxes();"><font color="000000"><b>Paused at Start   </b></font>
  336.        <input type=checkbox name=swfloop onclick="javascript:checkboxes();"><font color="000000"><b>Loop   </b></font>
  337.        <input type=checkbox name=swfmenu onclick="javascript:checkboxes();"><font color="000000"><b>Menu   </b></font></td>
  338.    </tr>   
  339.    <tr>
  340.    <td><font color="000000"><b>Dimensions:</b></font></td>
  341.    <td><select name="size" onchange="javascript:passText(this.options[this.selectedIndex].value)">
  342.       <option value="size" selected>Original Size
  343.       <option value="aspect">Original Aspect
  344.       <option value="any">Any Size</select>
  345.      <font face="arial, helvetica" size=2 color="000000"><b>W</b></font> <input type="text" size=4 maxlength=4 name=width value=" " onChange="javascript:widthchg(this.form.size.value);">
  346.        <font color="000000"><b>H</b></font> 
  347.    <input type="text" size=4 maxlength=4 name=height value=" " onChange="javascript:heightchg(this.form.size.value);">
  348.    <center><font size=1 face="arial" color="000000"><b>The preview size below may not match edited dimensions</b></font></center>
  349.    </td></tr></table>
  350. </FORM>
  351.  
  352. <SCRIPT LANGUAGE="JavaScript">
  353. <!-- Begin
  354.  
  355. ReadSelectedObject( document.editor );
  356. document.write( SWF_HTML( 0 ) );
  357. if(window.external.GetObjectHTML("-1")==defined)
  358.       WriteSelectedObject( document.editor );
  359.  
  360.  
  361. // End -->
  362. </SCRIPT>
  363.  
  364. </table>
  365. </center>
  366.  
  367. <!--Start Promotional Stuff -->
  368. <br><table width=420 cellspadding=0 cellspacing=0 >
  369. <tr><td><font face="arial, helvetica" size=2 color="D9D9D9"><b>
  370. Flare files are created by <a href="http://www.imediabuilders.com" target="imediawin">iMEDIA Builders</a> for publishing with Cool Page. 
  371. iMEDIA Builders.com and CoolPage.com are owned by separate companies.
  372. <p>All Flash (SWF) movies published with a FlareSWFlet, FlareExpress, or FlareWorks 
  373. are compatible with CoolPage's drag-n-drop, resizing, positioning, publishing 
  374. and unlimited undo features.
  375. <p>iMEDIA Builders has <a href="http://www.swflets.com">Flare SWFlets</a> to easily create 
  376. Text Effects, Ad Banners, and Animation Clips including the ability to custom scale, opacity, 
  377. rotate, motion paths, and other effects.  You can pick the font type, size, color, load any 
  378. GIF or JPG image and set the URL link.  Please visit <a href="http://www.imediabuilders.com" 
  379. target="imediawin"> iMEDIA Builders</a> to view and download Flare Products and free Flash 
  380. animation templates. </font>
  381. </td></tr></table></center>
  382. <!--End Promotional Stuff -->
  383.  
  384. </BODY>
  385. </HTML>
  386.